package com.ruoyi.procurementmanagement.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 采购价格历史对象 purchase_price_history
 *
 * @author ruoyi
 * @date 2025-05-27
 */
public class PurchasePriceHistory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long goodsId;

    /** 供应商ID */
    @Excel(name = "供应商ID")
    private Long supplierId;

    /** 采购订单ID */
    @Excel(name = "采购订单ID")
    private Long orderId;

    /** 采购价格 */
    @Excel(name = "采购价格")
    private BigDecimal price;

    /** 采购数量 */
    @Excel(name = "采购数量")
    private BigDecimal quantity;

    /** 税率 */
    @Excel(name = "税率")
    private BigDecimal taxRate;

    /** 采购日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采购日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date purchaseDate;

    /** 创建人 */
    @Excel(name = "创建人")
    private String creator;

    private ErpGoods erpGoods;

    private ErpSuppliers erpSuppliers;

    // 统计字段
    private Double avgPrice;
    private Double minPrice;
    private Double maxPrice;
    private Integer supplierCount;
    private Integer year;
    private Integer month;

// 记得生成getter和setter

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setGoodsId(Long goodsId)
    {
        this.goodsId = goodsId;
    }

    public Long getGoodsId()
    {
        return goodsId;
    }
    public void setSupplierId(Long supplierId)
    {
        this.supplierId = supplierId;
    }

    public Long getSupplierId()
    {
        return supplierId;
    }
    public void setOrderId(Long orderId)
    {
        this.orderId = orderId;
    }

    public Long getOrderId()
    {
        return orderId;
    }
    public void setPrice(BigDecimal price)
    {
        this.price = price;
    }

    public BigDecimal getPrice()
    {
        return price;
    }
    public void setQuantity(BigDecimal quantity)
    {
        this.quantity = quantity;
    }

    public BigDecimal getQuantity()
    {
        return quantity;
    }
    public void setTaxRate(BigDecimal taxRate)
    {
        this.taxRate = taxRate;
    }

    public BigDecimal getTaxRate()
    {
        return taxRate;
    }
    public void setPurchaseDate(Date purchaseDate)
    {
        this.purchaseDate = purchaseDate;
    }

    public Date getPurchaseDate()
    {
        return purchaseDate;
    }
    public void setCreator(String creator)
    {
        this.creator = creator;
    }

    public String getCreator()
    {
        return creator;
    }

    public ErpGoods getErpGoods() {
        return erpGoods;
    }

    public void setErpGoods(ErpGoods erpGoods) {
        this.erpGoods = erpGoods;
    }

    public ErpSuppliers getErpSuppliers() {
        return erpSuppliers;
    }

    public void setErpSuppliers(ErpSuppliers erpSuppliers) {
        this.erpSuppliers = erpSuppliers;
    }

    public Double getAvgPrice() {
        return avgPrice;
    }

    public void setAvgPrice(Double avgPrice) {
        this.avgPrice = avgPrice;
    }

    public Double getMinPrice() {
        return minPrice;
    }

    public void setMinPrice(Double minPrice) {
        this.minPrice = minPrice;
    }

    public Double getMaxPrice() {
        return maxPrice;
    }

    public void setMaxPrice(Double maxPrice) {
        this.maxPrice = maxPrice;
    }

    public Integer getSupplierCount() {
        return supplierCount;
    }

    public void setSupplierCount(Integer supplierCount) {
        this.supplierCount = supplierCount;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("goodsId", getGoodsId())
            .append("supplierId", getSupplierId())
            .append("orderId", getOrderId())
            .append("price", getPrice())
            .append("quantity", getQuantity())
            .append("taxRate", getTaxRate())
            .append("purchaseDate", getPurchaseDate())
            .append("creator", getCreator())
            .append("createTime", getCreateTime())
                .append("erpGoods",getErpGoods())
                .append("erpSuppliers",getErpSuppliers())
                .append("avgPrice",getAvgPrice())
                .append("minPrice",getMinPrice())
                .append("maxPrice",getMaxPrice())
                .append("supplierCount",getSupplierCount())
                .append("year",getYear())
                .append("month",getMonth())
            .toString();
    }
}
